// 对 uni.request() 请求封装
function request(params) {
	uni.showLoading({
		title: '加载中'
	});

	return new Promise((resolve, reject) => {
		uni.request({
			...params,
			header: {
				'Authentication': uni.getStorageSync("token"),
				'Content-Type': 'application/x-www-form-urlencoded'
			},
			success(res) {
				resolve(res.data);
			},
			complete() {
				uni.hideLoading();
			}
		})
	})

}

export default request;
